from appium import webdriver
import time
from appium.options.common import AppiumOptions
from appium.webdriver.common.appiumby import AppiumBy


option = AppiumOptions()
option.set_capability('platformName','android')
option.set_capability('platformVersion','7.1.2')
option.set_capability('deviceName','emulator-5554')
option.set_capability('appPackage','com.tencent.mm')
option.set_capability('appActivity','.ui.LauncherUI')
option.set_capability('noReset','true')
option.set_capability('newCommandTimeout','180')
driver = webdriver.Remote(command_executor='http://127.0.0.1:4723/wd/hub',options=option)
time.sleep(10)
print('点击微信搜索框')

driver.find_element(by=AppiumBy.ID, value="fhs").click()
time.sleep(10)
print('在搜索框输入搜索信息')

time.sleep(3)
driver.quit()
